package com.marsoft.test.controller;

import com.marsoft.test.entity.SecuredLoanInfoEntity;
import com.marsoft.test.entity.SecuredTransitBusinessEntity;
import com.marsoft.test.service.SecuredService;
import com.marsoft.test.utils.ResultMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author FAN_c
 * @date 2021/5/20 17:52
 * @description
 */
@RestController
@RequestMapping("Secured")
public class SecuredController {

    @Autowired
    private SecuredService securedService;

    @RequestMapping("/findAllSecuredLoanInfo")
    public ResultMap findAllSecuredLoanInfo(){

        List<SecuredLoanInfoEntity> allSecuredLoanInfo = securedService.findAllSecuredLoanInfo();

        return ResultMap.ok().put("date",allSecuredLoanInfo);

    }

    @RequestMapping("/findSecuredTransitBusiness")
    public ResultMap findSecuredTransitBusiness(){

        List<SecuredTransitBusinessEntity> securedTransitBusiness = securedService.findSecuredTransitBusiness();

        return ResultMap.ok().put("date",securedTransitBusiness);
    }
}
